package com.king;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

import com.king.util.LoadFXML;

import javafx.application.Application;

/**
 * 启动器，如果直接在APP中使用main方法，需要配置model，此处我就不处理了，直接这么写就没事了
 * https://rgielen.net/posts/2019/creating-a-spring-boot-javafx-application-with-fxweaver/
 * 
 * @author king
 * @date 2025年6月12日-13:05:35
 */
@SpringBootApplication
public class AppStarter {
	public static void main(String[] args) {
		Application.launch(App.class, args);
	}

	@Bean
	LoadFXML loadFXML(ConfigurableApplicationContext applicationContext) {
		return new LoadFXML(applicationContext::getBean, applicationContext::close);
	}
}
